home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / fractal / kaos.lha / fftlib / fft_write.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-01-22  |  546 b   |  24 lines

  1. #include <stdio.h>
  2.  
  3. void fft_write(ftp)
  4. FILE *ftp;
  5. {
  6.         int i;
  7.     double power;
  8.         extern int tser_len,graph_logy;
  9.         extern double *fft;
  10.  
  11.         for(i=0;i<tser_len;i++){
  12.         power = fft[2*i]*fft[2*i]+fft[2*i+1]*fft[2*i+1];
  13.         if(graph_logy==1 && power==0)
  14.                     fprintf(ftp,"%d 1.e-10\n",i);
  15.         else
  16.                     fprintf(ftp,"%d %.14lg\n",i,power);
  17.                 if(graph_logy==1)
  18.                         fprintf(ftp,"%d 1.e-10\n",i);
  19.                 else
  20.                         fprintf(ftp,"%d 0\n",i);
  21.         }
  22. }
  23.  
  24.